﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Twodi.Input
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="T">Tipo do State.</typeparam>
    /// <typeparam name="M">Tipo do Evento.</typeparam>
    public abstract class AbstractInput<T, M> : GameComponent
    {
        /// <summary>
        /// Construtor default.
        /// </summary>
        /// <param name="game"></param>
        public AbstractInput(Game game)
            : base(game)
        {
            Events = new List<M>();
        }

        /// <summary>
        /// Trocar mouse states antigo e novo.
        /// </summary>
        protected virtual void SwapStates()
        {
            OldState = State;
        }

        /// <summary>
        /// Invocar eventos.
        /// </summary>
        protected abstract void CallEvents();

        /// <summary>
        /// Estado atual do input.
        /// </summary>
        public T State
        {
            get;
            protected set;
        }

        /// <summary>
        /// Estado antigo do input.
        /// </summary>
        public T OldState
        {
            get;
            protected set;
        }

        public List<M> Events;
    }
}
